package com.dsz.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dsz.dao.OrderDao;
import com.dsz.po.Order;
@Service
@Transactional
public class OrderServiceImpl implements OrderService {
	//依赖注入
	@Autowired
	private OrderDao orderDao;
	@Override
	public List<Order> findAllOrder() {
		// 查询所有订单
		List<Order> listorder = orderDao.findAllOrder();
		return listorder;
	}
	// 添加订单
	@Override
	public int addOrder(Order order) {
		int rows = orderDao.addOrder(order);
		return rows;
	}
	//删除订单
	@Override
	public int deleteOrder(Integer code) {
		int rows = orderDao.deledtOrder(code);
		return rows;
	}

}
